<?php
session_start();
if($_SESSION['userid']==null) {
	echo '<script>window.location="index.php"</script>';
	die();
}

require_once("db_login.php");

$row = $_POST['arr'];
for($i=0; $i<count($row); $i++) {
	if($_POST['cmd']=="批准"){
		$sql = "UPDATE t_content SET is_pass1=1, pass1_time='".date("Y-m-d",time())."' WHERE cid=".intval($row[$i]);
	} else if($_POST['cmd']=="拒绝") {
		$sql = "UPDATE t_content SET is_pass1=2, not_pass_time1='".date("Y-m-d",time())."' WHERE cid=".intval($row[$i]);
	}
	mysql_query($sql);
	// echo $sql;
}
echo '<script>window.location="checking.php"</script>';
?>